const fs = require('fs');
fs.mkdir('./练习', err => {
    if (err) {
        console.log(err);
        return
    }
});

let dirArr = fs.readdirSync('./../node');
console.log(dirArr);

dirArr.forEach(item => {
    if (item != '练习') {
        let data = fs.readFileSync(`./${item}`)
        fs.writeFileSync(`./练习/${item}`, data)

    }
})

let textDirArr = fs.readdirSync('./练习');
console.log(textDirArr);
textDirArr.forEach(item => {
    let arr = item.split('_');
    if (arr.length > 1) {
        fs.renameSync('./练习/' + item, './练习/0' + item)
    } else {
        fs.renameSync('./练习/' + item, './练习/0-0' + item)
    }
})